package crudfx.container;
import crudfx.interop.*;
import java.awt.*;
import crudfx.data.*;
import javax.swing.*;
import javax.swing.border.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class Margin extends UIComponent {
    var panel:JamTop;
    public var content:UIComponent;
    public var left:Number on replace {setMargin();};
    public var top:Number on replace {setMargin();};
    public var right:Number on replace {setMargin();};
    public var bottom:Number on replace {setMargin();};
    function setMargin(){
        panel.getJComponent().setBorder(new EmptyBorder(top,left,bottom,right));
        }
    init{
        panel=JamTop{
            content:bind content
            }
        setMargin();
        }
    override public function getJComponent():JComponent{
        return panel.getJComponent();
        }
    override public function highlight(s:String):Boolean{
        return panel.highlight(s);
        }
    override public function gather():DataTree{
        var me:DataTree=DataTree{ name:"Margin" };
        insert content.gather() into me.node("content").children;
        return me;
        }
    }
